$(function(){
    $('#conventionDay').datepicker({
		dateFormat: 'yy-mm-dd',
    });
});

$(document).ready(function() {
	showEndStateInput();
});

function showEndStateInput() {
	var o = $('#end_state');

	if(o.val() == 1) {
		showPlagin('#end_win_count_lavel');
		showPlagin('#end_win_count_value');
		hidePlagin('#end_limit_time_min_lavel');
		hidePlagin('#end_limit_time_min_value');
	} else {
		showPlagin('#end_limit_time_min_lavel');
		showPlagin('#end_limit_time_min_value');
		hidePlagin('#end_win_count_lavel');
		hidePlagin('#end_win_count_value');
	}
}

function showPlagin(id){
	var o = $(id).get(0);
	o.style.display = "block";
}

function hidePlagin(id){
	var o = $(id).get(0);
	o.style.display = "none";
}